<?php

require_once("classes/functions.php");
require_once("classes/db_functions.php");

$db = new db_functions();

$userid=57;
$date = "10.11.2007";
$fixtime=-1;	//DAN



/*****************************************************************************/


$tmp = explode(".",$date);
$time_start	= makeUnixTime(0,0,0,$tmp[1],$tmp[0],$tmp[2]);
$time_end 	= makeUnixTime(23,59,59,$tmp[1],$tmp[0],$tmp[2]);
$fix = $fixtime*24*60*60;

$q = "SELECT id,time FROM duznici WHERE user=$userid AND time>=$time_start AND time<=$time_end";
$res = $db->select2($q);

if ($res !== false) {
	foreach ($res as $row){
		$id = $row["id"];
		$time = $row["time"];
		
		$q = "UPDATE duznici SET time=".($time+$fix)." WHERE id=$id LIMIT 1";
		echo "$q;<br />";
	}
}

?>